package com.tangly.module.service.impl;

import com.tangly.module.mapper.BannerMapper;
import com.tangly.common.base.BaseServiceImpl;
import com.tangly.module.entity.BannerEntity;
import com.tangly.module.service.IBannerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * created by yehao on 2018/7/24.
 */
/**
 * @author yetuhao
 * @since JDK 1.7
 * @description  重写BaseServiceImple中的部分方法以实现缓存注解
 */
@Service
@Slf4j
@CacheConfig(cacheNames = {"banner"})
public class BannerServiceImpl extends BaseServiceImpl<BannerEntity> implements IBannerService {

    @Autowired
    private BannerMapper mapper;

    @Override
    @Cacheable
    public List<BannerEntity> selectAll() {
        return super.selectAll();
    }
}
